package com.cwh.taskcenter.domain.notice.model;

import com.cwh.taskcenter.notice.dto.ChannelConfigDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author cwh
 */
@Data
public class TaskNotification {

    /**
     * 任务ID
     */
    private Long taskId;

    /**
     * 触发规则
     */
    @Schema(description = "触发规则")
    private NotifyTrigger notifyTrigger;

    /**
     * 通知渠道
     */
    @Schema(description = "通知渠道")
    private TaskNotificationChannel channels;


    @Schema(description = "通知渠道配置")
    private List<ChannelConfigDTO> channelConfigs;

    /**
     * 通知
     */
    @Schema(description = "通知")
    private AdvancedConfig advanced;

    public boolean isCompleteSend() {
        return notifyTrigger != null && notifyTrigger.isComplete();
    }

}
